Config Api
API for management of config files. If writing in Java, consider using ConfigApiJava where possible.
Configs can de/serialized from File, string, or raw TomlElement. File read is performed with validation and correction.
Author
fzzyhmstrs
Since
0.1.0
Functions
Deserializes a config from a string.
Deserializes a config class from a TomlElement
Whether a config corresponding to the provided scope is registered
Returns whether a config corresponding to the provided scope has been loaded or not, on the specified load side.
Provides an instance of the NetworkApi for usage of the built-in cross-loader networking API
Opens a config GUI. Does nothing on the server (But is not marked with @Environment, allowing for safe inclusion anywhere in code)
Parses a resource reader into a TomlElement for use in Codecs or other things.
Provides an instance of the PlatformApi for usage of the built-in cross-loader utilities
overload of readOrCreateAndValidate that automatically applies the name, folder, and subfolder from the config itself. Automatically adds ".toml" to the name for reading and writing.
Reads a config from File or Creates a new config class; writes out any corrections, updates, or new content to File. Automatically adds ".toml" to the name for reading and writing.
Creates and registers a Config. Use this over registerConfig and readOrCreateAndValidate if possible.
Registers a Config to registries. Does NOT load or validate it from file. Use this if you have custom initialization to perform, otherwise use registerAndLoadConfig for full initialization functionality.
Serializes a config class to a string.
Serialize a config class to a TomlElement